package com.example.common_base.net

import androidx.lifecycle.LifecycleOwner

public class NetHelper {


    companion object {
        private lateinit var netHelper: NetHelper

        fun aa() {

        }

       public fun getInstance(): NetHelper {
            if (!::netHelper.isInitialized) {
                netHelper = NetHelper()
            }
            return netHelper

        }
    }


    fun <T>getMyApi(t: Class<T>):T {
        return SystemApi.provideService(t)

    }
    fun testApi(): TestApi {
        return SystemApi.provideService(TestApi::class.java)
    }




    fun getApi(owner: LifecycleOwner) {
        val provideService = SystemApi.provideService(TestApi::class.java)
        provideService.data.compose(HttpObserver.schedulers())
            .`as`(RxLifecycleUtils.bindLifecycle(owner))

    }


}